package it.polimi.comorazio.data;

import it.polimi.comorazio.data.DataBaseHelper.Architect;

import java.util.Arrays;
import java.util.List;

import android.database.Cursor;

public class ArchitectVo {
	private String name;
	private String biography;
	private String born;
	private String died;
	private String moreInfoLink;
	private Integer id;

	public ArchitectVo(Cursor c, int position, String lang) {
		c.moveToPosition(position);
		List<String> columns = Arrays.asList(c.getColumnNames());
		id = c.getInt(columns.indexOf(Architect._ID));
		name = c.getString(columns.indexOf(Architect.COLUMN_NAME));
		biography = c.getString(columns.indexOf(Architect.COLUMN_BIOGRAPHY
				+ lang));
		born = c.getString(columns.indexOf(Architect.COLUMN_BORN));
		died = c.getString(columns.indexOf(Architect.COLUMN_DIED));
		moreInfoLink = c.getString(columns
				.indexOf(Architect.COLUMN_MORE_INFO_LINK));
	}

	@Override
	public String toString() {
		return "ArchitectVo [name=" + name + ", biography=" + biography
				+ ", born=" + born + ", died=" + died + "]";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getBiography() {
		return biography;
	}

	public void setBiography(String biography) {
		this.biography = biography;
	}

	public String getBorn() {
		return born;
	}

	public void setBorn(String born) {
		this.born = born;
	}

	public String getDied() {
		return died;
	}

	public void setDied(String died) {
		this.died = died;
	}

	public String getMoreInfoLink() {
		return moreInfoLink;
	}

	public void setMoreInfoLink(String moreInfoLink) {
		this.moreInfoLink = moreInfoLink;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

}
